﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommonLib;

namespace Cinema
{
    public struct FilmScreeningUniqueKey
    {
        private FilmUniqueKey _filmUniqueKey;
        private DateTime _startTime;

        public FilmScreeningUniqueKey(FilmUniqueKey filmUniqueKey, DateTime startTime)
        {
            _filmUniqueKey = filmUniqueKey;
            _startTime = startTime;
        }

        public FilmUniqueKey FilmUniqueKey
        {
            get { return _filmUniqueKey; }
            internal set { _filmUniqueKey = value; }
        }

        public DateTime StartTime
        {
            get { return _startTime; }
            internal set { _startTime = value; }
        }

        public override int GetHashCode()
        {
            return FilmUniqueKey.GetHashCode() ^ StartTime.GetHashCode();
        }
    }

    public interface IFilmScreening : ICinemaBusinessEntity<FilmScreeningUniqueKey>
    {
        IFilm Film { get; }
        TimeRange ScreeningTime { get; set; }
        ushort TicketsSold { get; set; }
    }
}
